import 'dart:async';

import '../core.dart';
import '../model/log.dart';
import '../model/options.dart';
import 'index.dart';

/// 自动上报pv管道
NormalLogPipe createPvPipe(Core aegis) {
  Timer(const Duration(milliseconds: 1), () {
    String pvUrl = aegis.config.pvUrl;
    aegis.send(options: Options(url: pvUrl, type: SendType.pv));
  });

  return (List<NormalLog> msgs, Resolve resolve) {
    resolve(msgs);
  };
}
